package Servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Ychiha
 * @version 1.0
 * @date 21/12/2021 下午8:59
 */
//SpringBoot整合Servlet (需要在启动类处扫描注解)
@WebServlet(name = "demo" , urlPatterns = "/servlet")
public class Servlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.getWriter().write("hello Servlet");
    }
}
